// OwnerEdit.cpp : implementation file
//

#include "stdafx.h"
#include "OwnerEdit.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// COwnerEdit

COwnerEdit::COwnerEdit()
{
	m_BoundryBrush.CreateSolidBrush(RGB(187,200,143));
}

COwnerEdit::~COwnerEdit()
{
	m_BoundryBrush.DeleteObject();
}


BEGIN_MESSAGE_MAP(COwnerEdit, CEdit)
	//{{AFX_MSG_MAP(COwnerEdit)
	ON_WM_NCPAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COwnerEdit message handlers

LRESULT COwnerEdit::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
	// TODO: Add your specialized code here and/or call the base class
	m_Track.WindowProc(message, wParam, lParam);

	return CEdit::WindowProc(message, wParam, lParam);
}
void COwnerEdit::PreSubclassWindow() 
{
	// TODO: Add your specialized code here and/or call the base class
	
	CEdit::PreSubclassWindow();

	m_Track.Init(GetSafeHwnd(), this);
}

void COwnerEdit::OnNcPaint() 
{
	// TODO: Add your message handler code here
	CWindowDC DC(this);
	CRect Rect;
	GetWindowRect(&Rect);

	if (m_Track.IsHover())
	{
		DC.SelectObject(&m_BoundryBrush);
		DC.Rectangle(0,0,Rect.Width(),Rect.Height());		
	}
	else
	{
		DC.DrawEdge(CRect(0,0,Rect.Width(),Rect.Height()),EDGE_SUNKEN,BF_FLAT|BF_RECT);
	}

	// Do not call CEdit::OnNcPaint() for painting messages
}

void COwnerEdit::OnHoverEnter()
{
	RedrawWindow(NULL,NULL,RDW_FRAME|RDW_INVALIDATE);
}
void COwnerEdit::OnHoverLeave()
{
	RedrawWindow(NULL,NULL,RDW_FRAME|RDW_INVALIDATE);
}
void COwnerEdit::OnHoverMove(UINT nFlags, CPoint point)
{

}









































